package sevensoft.结构型模式.组合模式;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

public class FileItem extends FileComponent{


    public FileItem(String name, int level) {
        super(name, level);
    }

    @Override
    public FileComponent add(FileComponent fileComponent) {
        throw new UnsupportedOperationException();
    }

    @Override
    public FileComponent remove(FileComponent fileComponent) {
        throw new UnsupportedOperationException();
    }

    @Override
    public FileComponent getChild(int level) {
        return null;
    }

    @Override
    public void out() {
        for ( int i = 0; i < level; i++ ) {
            System.out.print("——");
        }
        System.out.println(name);
    }
}
